import { uniFetch } from "@/pages/api/http.js";
// 报修审核列表
export const getRepairApplyList = (params) => {
  return uniFetch({
    url: "/blade-repair/repairApply/my-applies",
    method: "GET",
    data: params,
  });
};

// 报修审核详情
export const getRepairApplyDetail = (id) => {
  return uniFetch({
    url: "/blade-repair/repairApply/detail",
    method: "GET",
    data: { id },
  });
};

// 审核记录
export const getRepairApprovalBusiness = (params) => {
  return uniFetch({
    url: "/blade-repair/repairApproval/business",
    method: "GET",
    data: params,
  });
};

// 处理进度
export const getRepairRecordList = (params) => {
  return uniFetch({
    url: "/blade-repair/repairRecord/list",
    method: "GET",
    data: params,
  });
};

// 维修信息
export const getMalfunctionRepairOrder = (params) => {
  return uniFetch({
    url: "/blade-repair/repairOrder/detail",
    method: "GET",
    data: params,
  });
};

// 工作量
export const getRepairWorkloadList = (params) => {
  return uniFetch({
    url: "/blade-repair/repairWorkload/list",
    method: "GET",
    data: params,
  });
};

// 审批通过
export const approveRepairApply = (data) => {
  return uniFetch({
    url: "/blade-repair/repairApply/approve",
    method: "POST",
    data,
  });
};

// 驳回申请
export const rejectRepairApply = (data) => {
  return uniFetch({
    url: "/blade-repair/repairApply/reject",
    method: "POST",
    data,
  });
};

// 撤销审批
export const revokeApproval = (applyId) => {
  return uniFetch({
    url: "/blade-repair/repairApply/revoke-approval?applyId=" + applyId,
    method: "POST",
  });
};
